package com.bocloud.cmp.dao.app;

import java.util.List;
import java.util.Map;
import com.bocloud.cmp.entity.app.resource.OpenshiftCluster;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;
import com.bocloud.database.core.intf.GenericDao;
/**
 * @author Zaney
 * @data:2017年3月28日
 * @describe:openshift集群dao接口
 */
public interface OpenshiftClusterDao extends GenericDao<OpenshiftCluster, Long> {
	/**
	 * 查询符合条件的数据数量
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;
	/**
	 * 查询集群列表
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<OpenshiftCluster> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;
	/**
	 * 查询集群简易列表
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;
	/**
	 * 查询集群详情
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public OpenshiftCluster query(Long id) throws Exception;
	/**
	 * 删除集群信息
	 * @param id
	 * @param userId
	 * @return
	 * @throws Exception
	 */
	public boolean deleteById(Long id, Long userId) throws Exception;
	
	/**
	 * 按照应用id查询集群
	 * @author zjm
	 * @date 2017年4月9日
	 *
	 * @param appId
	 * @return
	 * @throws Exception
	 */
	public List<SimpleBean> listOpenshiftClusterByAppId(Long appId) throws Exception;
	/**
	 * 根据集群主机域名查询集群信息
	 * @param proxyUrl
	 * @return
	 * @throws Exception
	 */
	public OpenshiftCluster getOpenshiftClusterByproxyUrl(String proxyUrl) throws Exception;
	/**
	 * 获取所有的集群
	 * @return
	 * @throws Exception
	 */
	public List<OpenshiftCluster> selectAllCluster() throws Exception;
	/**
	 * 名称校验
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public OpenshiftCluster checkName(String name) throws Exception;
}
